<template>
    <div>
        <a-card>
            <a-result v-show="this.success" title="生成完毕,快去重启后端，调整页面吧!">
                <template #icon>
                    <a-icon type="like" theme="twoTone"/>
                </template>
                <template #extra>
                    <a-button type="primary" @click="again">
                        再来一次
                    </a-button>
                </template>
            </a-result>
            <a-result v-show="!this.success" title="生成失败!">
                <template #icon>
                    <a-icon type="frown" theme="twoTone" two-tone-color="#ff4d4f"/>
                </template>
                <template #extra>
                    <a-button type="primary" @click="again">
                        再来一次
                    </a-button>
                </template>
            </a-result>
        </a-card>
    </div>
</template>

<script>
  import {mapMutations, mapState} from 'vuex'

  export default {
    name: "ThirdlyCard",
    computed: {
      ...mapState('workplace', ['generate', 'current', 'success'])
    },
    methods: {
      ...mapMutations('workplace', ['setState']),
      again() {
        this.setState({name: 'current', value: 0})
        this.setState({name: 'generate', value: {}})
      }
    }
  }
</script>

<style scoped>

</style>